import { useState, useContext } from 'react';
import { Space, Table, Tag, Input, Button, Layout, Spin } from 'antd';
import type { TableProps } from 'antd';
import { PlusOutlined } from '@ant-design/icons';
import ConstructLayout from '@/new-components/layout/Construct';
import { DthesaurusContent, DthesaurusContentProvider } from '@/components/domain-thesaurus/dthesaurus-content';
import DomainMain from '@/components/domain-thesaurus/domain-main';
import DomainDetail from '@/components/domain-thesaurus/domain-detail';

const DomainContent = () => {
    const { pageType } = useContext(DthesaurusContent);

    return (
        <div>
            {pageType === 'list' ? <DomainMain /> : <DomainDetail />}
        </div>
    );
};

const domainThesaurus = () => {
    const [spinning, setSpinning] = useState<boolean>(false);

    return (
        <ConstructLayout>
            <Spin spinning={spinning}>
                <DthesaurusContentProvider>
                    <DomainContent />
                </DthesaurusContentProvider>
            </Spin>
        </ConstructLayout>
    );
};

export default domainThesaurus;